Expand description
Fork of Arc. This has the following advantages over std::sync::Arc:
triomphe::Arc
doesn’t support weak references: we save space by excluding the weak reference count, and we don’t do extra read-modify-update operations to handle the possibility of weak references.triomphe::UniqueArc
allows one to construct a temporarily-mutableArc
which can be converted to a regulartriomphe::Arc
latertriomphe::OffsetArc
can be used transparently from C++ code and is compatible with (and can be converted to/from)triomphe::Arc
triomphe::ArcBorrow
is functionally similar to&triomphe::Arc<T>
, however in memory it’s simply&T
. This makes it more flexible for FFI; the source of the borrow need not be anArc
pinned on the stack (and can instead be a pointer from C++, or anOffsetArc
). Additionally, this helps avoid pointer-chasing.triomphe::Arc
has can be constructed for dynamically-sized types viafrom_header_and_iter
triomphe::ThinArc
provides thin-pointerArc
s to dynamically sized typestriomphe::ArcUnion
is union of twotriomphe:Arc
s which fits inside one word of memory
Structs
- An atomically reference counted shared pointer
- A “borrowed
Arc
”. This is a pointer to a T that is known to have been allocated within anArc
. - A tagged union that can represent
Arc<A>
orArc<B>
while only consuming a single word. The type is alsoNonNull
, and thus can be stored in an Option without increasing size. - Structure to allow Arc-managing some fixed-sized data and a variably-sized slice in a single allocation.
- Header data with an inline length. Consumers that use HeaderWithLength as the Header type in HeaderSlice can take advantage of ThinArc.
- An
Arc
, except it holds a pointer to the T instead of to the entire ArcInner. - A “thin”
Arc
containing dynamically sized data - An
Arc
that is known to be uniquely owned
Enums
- This represents a borrow of an
ArcUnion
.